﻿<!DOCTYPE html>

<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="utf-8" />
    <title></title>
</head>
<body>
    <script>

        // trim() : 一个字符串的两端删除空白字符,它返回的是一个新的字符串
        var str = "  12 34  ";
        console.log(str.length);
        console.log(str.trim());
        console.log(str.trim().length);
    </script>
</body>
</html>